import React from 'react'

import './style.scss'

class star extends React.Component{
    constructor(props, context){
        super(props, context)
    }
    render() {
        let star = this.props.star
        if(star > 5) {
            star = star % 5
        }
        return (
            <div className='star-box'>
                {[1,2,3,4,5].map((item, index) => {
                    const lightClass = star >= item ? 'light' : ''
                    return <i key={index} className={'icon iconfont icon-icon-test6 ' + lightClass}></i>
                })}
            </div>
        )
    }
    componentDidMount() {
        
    }
}

export default star